package com.uplooking.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.uplooking.constant.CustConstants;
import com.uplooking.service.CustService;
import com.uplooking.service.ShopService;

@RestController
public class CommController {
	
	@Autowired
	private ShopService shopService;
	
	@Autowired
	private CustService custService;
	
	@GetMapping(value="/comm/type/list")
	public Object typeList() {
		return shopService.getTypeList();
	}

	@GetMapping(value="/comm/good/list")
	public Object goodList(@RequestParam(name="index")int index,
			@RequestParam(name="size")int size,
			@RequestParam(name="step")int step,
			@RequestParam(name="name",defaultValue="")String name,
			@RequestParam(name="type",defaultValue="")String type) {
		return custService.getGoodList(name, type, index, size, step);
	}
	
}
